package com.peaker.advertisingpro.bean

import androidx.room.Entity
import androidx.room.PrimaryKey
import com.google.gson.Gson
import com.peaker.advertisingpro.utils.Common
import com.peaker.advertisingpro.utils.SPUtil
import com.peaker.advertisingpro.utils.SmdtManagerUtils

/**
 *  @ 作者 CODE_LYF
 *  @ 时间   2021/4/10.
 *  代码人生
 */
data class loginBean(
    val type: String="1",
    val deviceId: String=SmdtManagerUtils.getAndroid_ID(),
    val encrypt: Int=0,
    val data: loginData = loginData()
)

data class loginData(
    var isActive: Int = if(SPUtil.getSP(Common.AUTH)=="是") 1 else 0
)

data class RegistBean(
    val `data`: registData?,
    val type: String
)

data class registData(
    var deviceId: String = "",
    var diskSpace: String = "",
    var firmware: String = "",
    var hardVersion: String = "",
    var ip: String = "",
    var isActive: String = "",
    var isBlacklight: String = "",
    var isGuard: String = "",
    var isMute: String = "",
    var isRootStart: String = "",
    var isStatus: String = "",
    var mac: String = "",
    var module: String = "",
    var resolution: String = "",
    var screen: String = "",
    var softVersion: String = "",
    var systemType: String = "",
    var type: String = "",
    var volume: String = "",
    var screenAngle: String = ""
)

class NullData {}

/*data class ResultBean(
    val code: String?
//    var data: T
)*/

data class loginResult(
    val register: String = "",
    val screen: String = "",
    val volume: String = "",
    val isMute: String = "",
    val autoActive: String = "",
    val isActive: String = "",
    val isBlacklight: String = "",
    val isRootStart: String = "",
    val isGuard: String = "",
    val isStatus: String = "",
    val aesPassword: String = ""
)

data class ResultBean<T>(
    var code: String?,
    var type: String?,
    var encrypt: String?,
    var data: T
)

data class ResultJson(
    var data: String?,
    var encrypt: Int=0

)

data class ReturnObject<T>(
    var code: String ?= null,
    var type: String = "",
    val deviceId: String=SmdtManagerUtils.getAndroid_ID(),
    var encrypt: Int = 0,
    var data: T? = null
)

/**
 * 发送的 数据
 */
data class SendObject(
    var type: String = "",
    val deviceId: String=SmdtManagerUtils.getAndroid_ID(),
    var encrypt: Int = 0,
    var data: Any? = null
)

/***
 * 激活时间
 */

data class ActiveTime(
    val startDate: String?,
    val endDate: String?
)

/**
 * 节目下载状态
 * @property apkUrl String?
 * @property version String?
 * @constructor
 */
data class PragrmStatusBean(
    val publishDetailId: String?,
    val status: String?
)

data class SetData(
    val isActive: String?,
    val isBlacklight: String?,
    val isBoot: String?,
    val isGuard: String?,
    val isRemoveShow: String?,
    val isRootStart: String?,
    val isStatus: String?,
    val isshutdown: String?,
    val lightValue: String?,
    val screen: String?,
    val screenAngle: String?,
    val volume: String?
)


data class UpDataBean(
    val apkUrl: String?,
    val id: String?,
    val version: String?
)

/**
 * 节目地址
 */

@Entity(tableName = "programdb")
data class ProgramUrlBean(
    var endDate: String?,
    var mode: String?,//追加 插播 替换 123
    var plan: String?, //持续  按时段 12
    var duration: Int = 10, //播放时间
    @PrimaryKey
    var programId: String,
    var programUrl: String?,//节目地址
    var startDate: String?,//开始时间
    var times: String?, //播放时段
    var weeks: String?,//播放周
    var playCount: Int? = 0,//播放次数
    var json: String?,//节目json
    var type: String?,//类型 0节目 1列表
    var materialIds: String?,//播放列表的json 文件id
    var publishDetailId: String?//下载id
)

/**
 * 播放列表json
 */
@Entity(tableName = "programjsondb")
data class ProgramJsonBean(
    var programId: String,
    @PrimaryKey
    var jsonId: String,
    var json: String?//节目json

)
data class Times(
    var off: String?,
    var on: String?
)

/**
 * 素材播放次数
 */

@Entity(tableName = "resplaydb")
data class ResPlayNum(
    @PrimaryKey
    var countId: String,
    var type: String,//1素材 2节目
    var number: Int = 0
)

/**
 * 开关机设置
 */
data class SwitchMachineSetBean(
    val bootTime: BootTimeStr?
)

data class BootTime(
    val highest: List<Highest>?,
    val specialTime: SpecialTime?,
    val week: String?
)

data class BootTimeStr(
    val highest: String?,
    val specialTime: String?,
    val week: String?
)

data class Highest(
    val offTime: String?,
    val onTime: String?
)

data class SpecialTime(
    val endDate: String?,
    val startDate: String?,
    val timeList: List<Time>?
)

data class Week(
    val friday: List<Friday>?,
    val monday: List<Monday>?,
    val saturday: List<Saturday>?,
    val sunday: List<Sunday>?,
    val thursday: List<Thursday>?,
    val tuesday: List<Tuesday>?,
    val wednesday: List<Wednesday>?
)

data class Time(
    val offTime: String?,
    val onTime: String?
)

data class Friday(
    val off: String?,
    val on: String?
)

data class Monday(
    val off: String?,
    val on: String?
)

data class Saturday(
    val off: String?,
    val on: String?
)

data class Sunday(
    val off: String?,
    val on: String?
)

data class Thursday(
    val off: String?,
    val on: String?
)

data class Tuesday(
    val off: String?,
    val on: String?
)

data class Wednesday(
    val off: String?,
    val on: String?
)

/**
 * 音量设置
 */
data class VolumeSetBean(
    val volumeSet: List<VolumeSet>?
)
/**
 * 开关机表
 */
@Entity(tableName = "switchtimedb")
data class SwitchDateBean(
    @PrimaryKey
    var type: String,//开关机类型  highest  最高优先级  specialTime  特殊事件 week  [安周统计
    var json: String?  //时间json

)

/**
 * 音量计划
 */
@Entity(tableName = "volumedb")
data class VolumeSet(
    @PrimaryKey(autoGenerate = true)
    var id:Long,
    var endTime: String?,
    var startTime: String?,
    var value: String?
)

/**
 * 心跳
 */

data class HeartBean(
    var data: String= Gson().toJson(HeartBean1()),
    var encrypt: Int=0

)
data class HeartBean1(
    val `data`: NullData = NullData(),
    val deviceId: String = SmdtManagerUtils.getAndroid_ID(),
    val encrypt: String = "0",
//    val deviceId: String = "6bb4b8db891a4116a85f897f953c0fba",
    val type: String = "0"
)

/**
 * 1007 节目下线
 */
data class OfflineBean(
    val id: String?,
    val type: String?,//0节目 1播放列表 2 插播内容
    val status: String?//0上线 1下线
)

/**
 * 1006上传截屏数据
 */

data class UPImgBean(
    val id: String?
)

/**
 * 插播json 1008
 */
@Entity(tableName = "InterPlaydb")
data class InterPlayBean(
    var bgColor: String?,
    @PrimaryKey
    var id: String,
    var bgOpacity: String?,
    var content: String?,
    var direction: String?,
    var endTime: String?,
    var fontColor: String?,
    var fontSize: String?,
    var name: String?,
    var number: Int = 1,
    var numbered: Int = 0,//已经播放了几次
    var position: String?,
    var speed: String?,
    var startTime: String?,
    var type: String?
)